| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | 'use strict' |
||
| 3 | module.exports = (input, callback) => { |
||
| 4 | const mqtt = require('mqtt') |
||
|
|
|||
| 5 | const validate = require('./validate') |
||
| 6 | let error = null |
||
| 7 | let output = null |
||
| 8 | |||
| 9 | validate(input, (validatedInput, thrownError) => { |
||
| 10 | input = validatedInput |
||
| 11 | error = thrownError |
||
| 12 | }) |
||
| 13 | |||
| 14 | output = { |
||
| 15 | 'version': {'ref': 'input'}, |
||
| 16 | 'metadata': [ |
||
| 17 | {'name': 'topic', 'value': 'Hulk Hogan'}, |
||
| 18 | {'name': 'timestamp', 'value': Date.now().toString()} |
||
| 19 | ] |
||
| 20 | } |
||
| 21 | |||
| 22 | |||
| 23 | callback(error, output, source) |
||
| 24 | } |
||
| 25 |